package base.exa12;

public class Human {
    public static void main(String args[]){
        //这条语句的执行意味着，money，leg，height，
        //action都被分配了空间
        Man you = new Man();
        you.action();//这条语句的执行说明了子类可以通过继承的方法来操作没继承来的变量
        System.out.println(you.getLeg());
    }
}

class People{
    private int leg = 2;
    int money;
    void action(){
        leg = 5;
        System.out.println("I am a man");
    }
    public int getLeg(){
        return leg;
    }
}

class Man extends People{
    int height;
}
